package com.ruoyi.web.controller.app;

import com.ruoyi.common.core.domain.R;
import com.ruoyi.framework.web.service.WxMpPaService;
import com.ruoyi.system.domain.bo.WxMessageBo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import me.chanjar.weixin.common.error.WxErrorException;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

/**
* @ClassName PaWxMpController
* @Description
* @date 2024/8/20 11:23  公众号操作都在管理端进行
* @Version 1.0
* @Auther: zhangzhenyu
*/
@Slf4j
@AllArgsConstructor
@RestController
@RequestMapping("/wx/mp")
@Api(tags = "发送消息")
public class PaWxMpController {

    private WxMpPaService wxMpPaService;

    @ApiOperation(value = "给用户发送消息", notes = "给用户发送消息")
    @RequestMapping(value = "/sendAdminMessage", method = RequestMethod.POST)
    public R sendUserMessage(@RequestBody WxMessageBo wxMessageBo, HttpServletRequest request) {
        return wxMpPaService.sendAdminMessage(wxMessageBo, request);

    }

}
